package com.novel.common.event;

import com.novel.mapper.DownLoadInfoMapper;
import com.novel.pojo.system.DownLoadInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;


@Slf4j
@Component
public class DownLoadInfoListener {

    @Autowired
    private DownLoadInfoMapper downLoadInfoMapper;

    @EventListener
    public void process(DownLoadInfoEvent event) {
        DownLoadInfo downLoadInfo = event.getDownLoadInfo();
        downLoadInfoMapper.insert(downLoadInfo);
    }

}